<template>
	<view>
		<view class="goods_wrap tn-flex tn-flex-col-center tn-flex-row-between">
			<view class="tn-flex tn-flex-col-center">
				<tn-checkbox-group v-if="show_check">
					<tn-checkbox v-model="item.selected" :name="item.name" activeColor="#AAAAAA" shape="circle"
						@change="radio_change"></tn-checkbox>
				</tn-checkbox-group>
				<img :src="item.img_path" alt="" class="img">
				<view class="goods_info">
					<view class="name">
						{{item.name}}
					</view>
					<view class="">
						<text class="price">¥ {{item.price}}</text>
						<text> /{{item.unit}}</text>
					</view>
				</view>
			</view>

			<view>
				<text v-show="!item.number" @click="item.number++" class="tn-icon-add-fill tn-color-blue"
					style="font-size:50rpx;padding-right: 20rpx;"></text>
				<tn-number-box v-show="item.number" v-model="item.number" backgroundColor="#eee"
					style="margin-right: 30rpx;"></tn-number-box>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => ({})
			},
			show_check: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				current_number: 0,
			}
		},
		onLoad() {

		},
		methods: {
			radio_change(e) {
				console.log('e', e);
			}
		}
	}
</script>

<style scoped lang="scss">
	::v-deep .tn-checkbox__icon-wrap--checked {
		background-color: #01BEFF !important;
		border-color: #01BEFF !important;
	}

	::v-deep .tn-checkbox__icon-wrap {
		border: 1rpx solid #999 !important;
		width: 40rpx !important;
		height: 40rpx !important;
	}

	.goods_wrap {
		width: 100%;
		margin-top: 30rpx;
		padding-bottom: 20rpx;
		border-bottom: 4rpx solid #efeaea;

		.img {
			// width: 150rpx;
			height: 120rpx;
		}



		.goods_info {
			margin-left: 40rpx;

			.name {
				margin-bottom: 15rpx;
				font-size: 40rpx;
			}

			.price {
				margin-top: 10rpx;
				font-size: 36rpx;
				color: red;
				font-weight: 600;
			}
		}
	}
</style>